<template>
  <div>
    <form>
      <label>姓名：</label>
      <input type="text" v-model="motto" /><br /><br />

      <label>年龄：</label>
      <input type="number" v-model.number="age"/><br /><br />

      <label>身高：</label>
      <input type="number" v-model.number="sg"/>(米)<br /><br />

      <label>体重：</label>
      <input type="number" v-model.number="tz"/>(公斤)<br /><br />

      <label>病史：</label>
      <input type="text" /><br /><br />

      <button @click.prevent="fu()">诊断</button>
    </form>

    <p v-show="isshows">患者 {{ motto }} 的诊断结果：{{bml}}</p>
  
  </div>
</template>

<script>
export default {
  data() {
    return {
      isshows: false,
      motto: '',
      age:0,
      sg:0,
      tz:0,
      bs:'',
      bml:0,
      

    }
  },
  methods: {
    fu() {
     this.isshows = true
     this.bml=this.tz/(this.sg*this.sg)
     if(this.bml<=20) {
      this.bml = '太轻'
     }else if(this.bml>25) {
      this.bml = '超重'

     }else {
      this.bml = '正常'
     }

    


    },
  },
}
</script>
